//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#if _MSC_VER > 1000
#pragma once
#endif

#ifndef __elatypes_h__
#define __elatypes_h__

#ifdef __cplusplus
extern "C"{
#endif

/* Forward Declarations */

/* interface __MIDL_itf_elatypes_0000 */
/* [local] */

#ifdef _GNUC
typedef long long __int64;   // gnu c does not know __int64
typedef unsigned long long __uint64;
#else
typedef unsigned __int64 __uint64;

#endif //

typedef unsigned char byte;  // MIDL knows byte but VC++ does not
typedef __int64 hyper;       // MIDL knows hyper but VC++ does not

typedef /* [public] */ byte BYTE;

typedef /* [public] */ BYTE *PBYTE;

typedef char CHAR;
typedef /* [public] */ CHAR *PCHAR;

typedef /* [public] */ unsigned char UCHAR;

typedef /* [public] */ UCHAR *PUCHAR;

typedef /* [public] */ short SHORT;

typedef /* [public] */ SHORT *PSHORT;

typedef /* [public] */ unsigned short USHORT;

typedef /* [public] */ USHORT *PUSHORT;

typedef /* [public] */ unsigned short WORD;

typedef /* [public] */ WORD *PWORD;

typedef /* [public] */ int Int32;

typedef /* [public] */ Int32 *PINT;

typedef /* [public] */ unsigned int UInt32;

typedef /* [public] */ UInt32 *PUINT;

typedef /* [public] */ long LONG;

typedef /* [public] */ LONG *PLONG;

typedef /* [public] */ unsigned long ULONG;

typedef /* [public] */ ULONG *PULONG;

typedef /* [public] */ unsigned long DWORD;

typedef /* [public] */ DWORD *PDWORD;

typedef /* [public] */ __int64 LONGLONG;

typedef /* [public] */ LONGLONG *PLONGLONG;

typedef /* [public] */ __uint64 ULONGLONG;

typedef /* [public] */ ULONGLONG *PULONGLONG;

typedef /* [public] */ __uint64 DWORDLONG;

typedef /* [public] */ DWORDLONG *PDWORDLONG;

typedef /* [public] */ signed char INT8;

typedef /* [public] */ unsigned char UINT8;

typedef /* [public] */ short INT16;

typedef /* [public] */ unsigned short UINT16;

typedef /* [public] */ int INT32;

typedef /* [public] */ unsigned int UINT32;

typedef /* [public] */ __int64 Int64;

typedef /* [public] */ __uint64 UInt64;

typedef /* [public] */ float FLOAT;

typedef /* [public] */ FLOAT *PFLOAT;

typedef /* [public] */ double DOUBLE;

typedef /* [public] */ DOUBLE *PDOUBLE;

typedef /* [public] */ long BOOL;

typedef /* [public] */ BOOL *PBOOL;

typedef /* [string] */ CHAR *PSTR;

typedef /* [string] */ const CHAR *PCSTR;

#if (defined(_GNUC) && defined(__cplusplus))

#else
typedef /* [public] */ unsigned short wchar_t;

#endif
typedef /* [public] */ wchar_t WCHAR;

typedef /* [public] */ wchar_t wint_t;

typedef /* [public] */ wchar_t wctype_t;

typedef struct  _FLAGGED_WORD_BLOB
    {
    unsigned long fFlags;
    unsigned long clSize;
    /* [size_is] */ unsigned short asData[ 1 ];
    }    FLAGGED_WORD_BLOB;

typedef /* [unique] */ FLAGGED_WORD_BLOB *wireBSTR;

typedef /* [wire_marshal] */ WCHAR *BSTR;

typedef /* [string] */ WCHAR *PWSTR;

typedef /* [string] */ const WCHAR *PCWSTR;

typedef /* [public] */ UINT32 INETADDR;

typedef /* [public] */ void VOID;

typedef /* [public] */ void *PVoid;

typedef /* [public] */ const void *PCVOID;

typedef /* [public] */ void *HANDLE;

typedef /* [public] */ HANDLE *PHANDLE;

typedef /* [public] */ ULONG Address;

typedef /* [public] */ UINT32 ADDR_SIZE;

typedef /* [public] */ UInt32 ADDR_PROT;

typedef /* [public] */ HANDLE HMODULE;

typedef /* [public] */ HANDLE HINSTANCE;

typedef /* [public] */ HANDLE HKEY;

typedef /* [public] */ HKEY *PHKEY;

#ifdef _GNUC
#ifdef _arm
typedef /* [public] */ unsigned long   size_t;
#else
typedef /* [public] */ unsigned int size_t;
#endif //_arm
#else
typedef /* [public] */ unsigned int size_t;

#endif //_GNUC

typedef /* [public] */ size_t SIZE_T;

typedef /* [public] */ SIZE_T *PSIZE_T;

typedef /* [public] */ __int64 fpos_t;

typedef /* [public] */ long off_t;

typedef /* [public] */ HANDLE HFILE;

#define HFILE_ERROR ((HFILE)-1)

typedef /* [public] */ HANDLE HGLOBAL;

typedef /* [public] */ HANDLE HLOCAL;

typedef /* [public] */ HANDLE HRSRC;

typedef /* [public] */ UINT32 COLORREF;

typedef /* [public] */ Int64 TIME;

typedef union _LARGE_INTEGER {
    struct {
        DWORD LowPart;
        LONG HighPart;
    } u;
    Int64 QuadPart;
} LARGE_INTEGER, *PLARGE_INTEGER;

typedef union _ULARGE_INTEGER {
    struct {
        DWORD LowPart;
        DWORD HighPart;
    } u;
    UInt64 QuadPart;
} ULARGE_INTEGER, *PULARGE_INTEGER;

typedef struct  _tagFILETIME
    {
    UINT32 dwLowDateTime;
    UINT32 dwHighDateTime;
    }    FILETIME;

typedef struct _tagFILETIME *PFILETIME;

#if defined(_MSC_VER)

#pragma pack(push, _BMP_STRUCT_)
#endif

#pragma pack(1)
typedef struct  _tagRGBQUAD
    {
    UINT8 rgbBlue;
    UINT8 rgbGreen;
    UINT8 rgbRed;
    UINT8 rgbReserved;
    }    RGBQUAD;

typedef struct  _tagRGBTRIPLE
    {
    UINT8 rgbtBlue;
    UINT8 rgbtGreen;
    UINT8 rgbtRed;
    }    RGBTRIPLE;

typedef struct  _tagBITMAPCOREHEADER
    {
    UINT32 bcSize;
    UINT16 bcWidth;
    UINT16 bcHeight;
    UINT16 bcPlanes;
    UINT16 bcBitCount;
    }    BITMAPCOREHEADER;

typedef struct _tagBITMAPCOREHEADER *PBITMAPCOREHEADER;

typedef struct  _tagBITMAPINFOHEADER
    {
    UINT32 biSize;
    INT32 biWidth;
    INT32 biHeight;
    UINT16 biPlanes;
    UINT16 biBitCount;
    UINT32 biCompression;
    UINT32 biSizeImage;
    INT32 biXPelsPerMeter;
    INT32 biYPelsPerMeter;
    UINT32 biClrUsed;
    UINT32 biClrImportant;
    }    BITMAPINFOHEADER;

typedef struct _tagBITMAPINFOHEADER *PBITMAPINFOHEADER;

typedef struct  _tagBITMAPFILEHEADER
    {
    UINT16 bfType;
    UINT32 bfSize;
    UINT16 bfReserved1;
    UINT16 bfReserved2;
    UINT32 bfOffBits;
    }    BITMAPFILEHEADER;

typedef struct _tagBITMAPFILEHEADER *PBITMAPFILEHEADER;

#pragma pack()
#if defined(_MSC_VER)

#pragma pack(pop, _BMP_STRUCT_)
#endif
typedef /* [public] */ INT32 HRESULT;

typedef /* [public] */ HRESULT *PHRESULT;

typedef /* [public] */ HRESULT SCODE;

typedef /* [public] */ WCHAR OLECHAR;

typedef /* [string] */ OLECHAR *POLESTR;

typedef /* [string] */ const OLECHAR *PCOLESTR;

#define OLESTR(str) L##str

typedef UINT32 LCID;

typedef DWORD (*PThreadMain)(
    PVoid pThreadParameter
    );
#ifndef GUID_DEFINED
#define GUID_DEFINED
typedef struct  _tagGUID
    {
    UINT32 Data1;
    UINT16 Data2;
    UINT16 Data3;
    UINT8 Data4[ 8 ];
    }    GUID;

typedef struct _tagGUID *PGUID;

#endif /* GUID_DEFINED */
typedef GUID IID;

typedef GUID *PIID;

typedef GUID CLSID;

typedef GUID *PCLSID;

typedef GUID CATID;

typedef GUID *PCATID;

typedef struct  EzCLSID
    {
    CLSID clsid;
    WCHAR *urn;
    }    EzCLSID;

typedef struct EzCLSID ClassID;

typedef struct EzCLSID EZCOM_CLSID;

typedef struct EzCLSID *PEZCLSID;

extern const GUID GUID_NULL;
#define IID_NULL   GUID_NULL
#define CLSID_NULL GUID_NULL

#if defined(__cplusplus)
#define REFGUID  const GUID &
#define RIID   const IID &
#define REFCLSID const CLSID &
#define REFCATID const CATID &
#define REFEZCOM_CLSID const EZCOM_CLSID &
#define REZCLSID const EzCLSID &
#else // !__cplusplus
#define REFGUID  const GUID * const
#define RIID   const IID * const
#define REFCLSID const CLSID * const
#define REFCATID const CATID * const
#define REFEZCOM_CLSID const EZCOM_CLSID * const
#define REZCLSID const EzCLSID * const
#endif // !__cplusplus

#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C extern
#endif

#ifndef _GNUC
#define DECLSPEC_SELECTANY __declspec(selectany)
#define DECLSPEC_NOVTABLE  __declspec(novtable)
#define DECLSPEC_UUID(x)   __declspec(uuid(x))
#else
#define DECLSPEC_SELECTANY
#define DECLSPEC_NOVTABLE
#define DECLSPEC_UUID(x)
#endif

#define interface  struct
#define MIDL_INTERFACE(x) interface DECLSPEC_UUID(x) DECLSPEC_NOVTABLE

#define EXTERN_GUID(itf,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8) \
    EXTERN_C const IID DECLSPEC_SELECTANY \
        itf = {l1,s1,s2,{c1,c2,c3,c4,c5,c6,c7,c8}}

#define STDAPICALLTYPE      __stdcall
#if defined(_GNUC)
#define STDMETHODCALLTYPE
#else
#define STDMETHODCALLTYPE   __stdcall
#endif

#define STDAPI              EXTERN_C HRESULT STDAPICALLTYPE
#define STDAPI_(type)       EXTERN_C type STDAPICALLTYPE

#define STDMETHODIMP            HRESULT STDMETHODCALLTYPE
#define STDMETHODIMP_(type)     type STDMETHODCALLTYPE

#define CONST_VTBL          const

#ifdef APIENTRY
#undef APIENTRY
#endif
#define APIENTRY            STDAPICALLTYPE
typedef int (STDAPICALLTYPE * FARPROC)();

#ifndef NULL
#ifdef __cplusplus
#define NULL    0
#else
#define NULL    ((void *)0)
#endif
#endif

#ifdef TRUE
#undef TRUE
#endif
#define TRUE (1==1)
#ifdef FALSE
#undef FALSE
#endif
#define FALSE (1==0)

#if (!defined(_MSC_VER) && !defined(__cdecl))
#define __cdecl  /* __cdecl is for Microsoft compilers only */
#endif
typedef struct {
    void * pMeaningless;
} INewObject;
#define NEW_COMPONENT(_ClassName_, dwClsContext) \
        _Create_##_ClassName_((REFCLSID)CLSID_##_ClassName_, dwClsContext)
#ifdef __cplusplus
#define INLINE inline
#elif defined(_MSC_VER)
#define INLINE __inline
#elif defined(DIAB_COMPILER)
#define INLINE /* only pragmas supported, don't bother */
#else
#define INLINE static __inline__ /* GNU c style */
#endif
#ifdef _GNUC
#define __asm __asm__
#define _asm __asm
#define ASM_VOLATILE    __asm__ __volatile__
#define ASM             ASM_VOLATILE
#else
#define _INTEL_SYNTAX
#endif

/* Additional Prototypes for ALL interfaces */

/* end of Additional Prototypes */

#ifdef __cplusplus
}
#endif

#endif
